//
//  AuthorizationManager.h
//  18Birdies
//
//  Created by weihuazhang on 2016/11/29.
//  Copyright © 2016年 Lc. All rights reserved.
//

#import "LcSingleton.h"

typedef enum {
  AUTHORIZATION_PUSHSTATE_INVITATION,
  AUTHORIZATION_PUSHSTATE_RECEIVE_INVITATION,
  AUTHORIZATION_PUSHSTATE_TOURNAMENT,
  AUTHORIZATION_PUSHSTATE_SHARED_ROUND,
  AUTHORIZATION_PUSHSTATE_FEED,
  AUTHORIZATION_PUSHSTATE_IMPROVE_GAME,
  AUTHORIZATION_PUSHSTATE_FIND_GOLF_EVENTS,
  AUTHORIZATION_PUSHSTATE_FIND_PEOPLE,
  AUTHORIZATION_PUSHSTATE_DISCOVER_COURSES,
  AUTHORIZATION_PUSHSTATE_DEFAULT,
  AUTHORIZATION_PUSHSTATE_DIRECTMESSAGE,
  AUTHORIZATION_PUSHSTATE_SWING_ANALIZE,
} AuthorizationPushState;

typedef enum {
  AUTHORIZATION_PHOTO,
  AUTHORIZATION_CAMERA,
  AUTHORIZATION_MICROPHONE,
  AUTHORIZATION_CONTACT,
  AUTHORIZATION_LOCATION,
  AUTHORIZATION_NOTIFICATION,
} AuthorizationType;

typedef void (^AuthorizationUseHandle)(BOOL accessGranted);
typedef void (^AuthorizationSkippedHandle)(BOOL accessGranted, BOOL isSkipped);
typedef void (^AuthorizationUseWithTypeHandle)(AuthorizationType type, BOOL accessGranted);

@interface AuthorizationManager : LcSingleton

- (BOOL)needShowAuthorization:(BOOL)isSignUp;
- (void)openSettingPage;

- (void)useSystemPhoto:(AuthorizationUseHandle)authorizationUseHandle;
- (void)useSystemCamera:(AuthorizationUseHandle)authorizationUseHandle;
- (void)useSystemPhotoAndCamera:(AuthorizationUseWithTypeHandle)authorizationUseWithTypeHandle;
- (void)useSystemMicrophone:(AuthorizationUseHandle)authorizationUseHandle;
- (void)useSystemLocation:(AuthorizationSkippedHandle)authorizationUseHandle;

- (void)doRequestLocationAccess:(AuthorizationUseHandle)authorizationUseHandle;

@end
